package com.until;

public class Testvolatile {
     static int  a;
    public  static  void main(String []args )
    {
        for (int i=0;i<2;i++)
        {
            new Thread(new Runnable() {
                public void run() {
                    System.out.println(Thread.currentThread().getName()+"start");
                    while (true)
                    {
                        System.out.println(Thread.currentThread().getName()+":"+a);
                        a++;
                    }
                }
            }).start();
        }

    }
}
